<!--
 * @Author: taoke
 * @Date: 2022-05-05 09:28:39
 * @LastEditors: taoke
 * @LastEditTime: 2022-05-11 16:59:00
 * @Description: 
 * @FilePath: \yunying-sys-cli4\src\components\partner\relation\topSearch.vue
-->
<template>
  <div class="search-box">
    <el-form
      ref="ruleForm"
      :inline="true"
      :model="formInline"
      class="demo-form-inline"
    >
      <!-- 输入搜索部分 -->
      <el-form-item label="搜索" prop="dpAccount">
        <el-input
          clearable
          v-model="formInline.dpAccount"
          placeholder="请输入大鹏号"
        ></el-input>
      </el-form-item>
      <el-form-item class="s-btn">
        <el-button
          type="success"
          icon="el-icon-search"
          @click="toSearch('ruleForm')"
        >
          查询
        </el-button>
        <el-button type="success" plain @click="reset">
          重置
        </el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    formInline: {
      type: Object,
      default: function() {
        return {
          dpAccount: '' //大鹏号
        }
      }
    }
  },
  methods: {
    /* 搜索 */
    toSearch(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.$emit('toSearch')
        } else {
          return false
        }
      })
    },
    /* 重置 */
    reset() {
      this.$refs['ruleForm'].resetFields()
    }
  }
}
</script>
<style scoped></style>
